#!/bin/bash

# Test the functionality of reducing identical snapshots

. ./common

for i in 0 1 2 3; do
    _start_sheep $i
done
_wait_for_sheep 4
_cluster_format -c 3

# test normal case

$DOG vdi create test 16M
$DOG vdi snapshot test
$DOG vdi snapshot test

$DOG vdi list | _filter_short_date

$DOG vdi delete test -s 1
$DOG vdi delete test -s 2
$DOG vdi delete test

# test reduced case

$DOG vdi create test 16M
$DOG vdi snapshot test -R
_random | $DOG vdi write test 0 512
$DOG vdi snapshot test -R

$DOG vdi list | _filter_short_date
